package net.huashitong.taskGroup.web;

import com.sirdc.modules.core.web.JsonBaseController;
import com.sirdc.modules.core.web.model.Message;
import net.huashitong.taskGroup.entity.JobGroup;
import net.huashitong.taskGroup.service.JobGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/jobGroup")
public class JobGroupCtrl extends JsonBaseController {
    @Override
    protected String getView(String s) {
        return null;
    }
    @Autowired
    private JobGroupService service;

    @ResponseBody
    @RequestMapping(value = "/queryAll",method = RequestMethod.GET)
    public Message queryAllGroup(){
        List<JobGroup> list = service.query();
        return coverMessage("200","获取成功",list);
    }
}
